<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class User
{
    public function check_username_password($username, $password)
    {
        $CI =& get_instance();
        $CI->load->database();
        
        $sql = "SELECT * FROM ". $CI->db->dbprefix('users') ."
                WHERE user_login_id = ?
                AND user_password = ?
                AND user_is_active = 1
                LIMIT 1";
        $query = $CI->db->query($sql, array($username, md5($password)));
        $row = $query->first_row();

        if ($query->num_rows() > 0)
        {
            return $row;
        }
        else
        {
            return false;
        }
    }
}

/* End of file user.php */
/* Location: ./application/libraries/user.php */